<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pin: TRACE: Single entrance, multiple exit sequence of instructions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Pin
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">TRACE: Single entrance, multiple exit sequence of instructions<div class="ingroups"><a class="el" href="group__API__REF.html">Instrumentation API Reference</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gafbca42a46e490ff446dd4c8e54ea182a"><td class="memItemLeft" align="right" valign="top">typedef TRACE_CLASS *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a></td></tr>
<tr class="separator:gafbca42a46e490ff446dd4c8e54ea182a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad80d434b4df6285334079c19df32a2e8"><td class="memItemLeft" align="right" valign="top">typedef VOID(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#gad80d434b4df6285334079c19df32a2e8">SMC_CALLBACK</a>) (ADDRINT traceStartAddress, ADDRINT traceEndAddress, VOID *v)</td></tr>
<tr class="separator:gad80d434b4df6285334079c19df32a2e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07cee21d7d56284f183d218ef0c7ebfe"><td class="memItemLeft" align="right" valign="top">typedef VOID(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga07cee21d7d56284f183d218ef0c7ebfe">TRACE_INSTRUMENT_CALLBACK</a>) (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace, VOID *v)</td></tr>
<tr class="separator:ga07cee21d7d56284f183d218ef0c7ebfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab2f19ff0a9198c83715eea79ada22503"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__PIN__CALLBACKS.html#ga80ecde10e25aa90133f29e875d21d61d">PIN_CALLBACK</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#gab2f19ff0a9198c83715eea79ada22503">TRACE_AddInstrumentFunction</a> (<a class="el" href="group__TRACE.html#ga07cee21d7d56284f183d218ef0c7ebfe">TRACE_INSTRUMENT_CALLBACK</a> fun, VOID *val)</td></tr>
<tr class="separator:gab2f19ff0a9198c83715eea79ada22503"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b5767a4ce4604d36829a1befa497223"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga2b5767a4ce4604d36829a1befa497223">TRACE_AddSmcDetectedFunction</a> (<a class="el" href="group__TRACE.html#gad80d434b4df6285334079c19df32a2e8">SMC_CALLBACK</a> fun, VOID *val)</td></tr>
<tr class="separator:ga2b5767a4ce4604d36829a1befa497223"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae5340cd88a962aac271e3547cdaa024e"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#gae5340cd88a962aac271e3547cdaa024e">TRACE_InsertCall</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace, <a class="el" href="group__INST__ARGS.html#ga707ea08e31f44f4a81e2a7766123bad7">IPOINT</a> action, AFUNPTR funptr,...)</td></tr>
<tr class="separator:gae5340cd88a962aac271e3547cdaa024e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3ce47adf064c67f7289836aa5eabe680"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga3ce47adf064c67f7289836aa5eabe680">TRACE_InsertIfCall</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace, <a class="el" href="group__INST__ARGS.html#ga707ea08e31f44f4a81e2a7766123bad7">IPOINT</a> action, AFUNPTR funptr,...)</td></tr>
<tr class="separator:ga3ce47adf064c67f7289836aa5eabe680"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga88d6254df161fa4aa236e092d8532278"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga88d6254df161fa4aa236e092d8532278">TRACE_InsertThenCall</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace, <a class="el" href="group__INST__ARGS.html#ga707ea08e31f44f4a81e2a7766123bad7">IPOINT</a> action, AFUNPTR funptr,...)</td></tr>
<tr class="separator:ga88d6254df161fa4aa236e092d8532278"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga025844ffbef1e892eed7d7ce46f98138"><td class="memItemLeft" align="right" valign="top">BBL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga025844ffbef1e892eed7d7ce46f98138">TRACE_BblHead</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga025844ffbef1e892eed7d7ce46f98138"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2466f702bf17676b4d37f728caa0692f"><td class="memItemLeft" align="right" valign="top">BBL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga2466f702bf17676b4d37f728caa0692f">TRACE_BblTail</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga2466f702bf17676b4d37f728caa0692f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35b565f6deabbcd077790219f57daeee"><td class="memItemLeft" align="right" valign="top">ADDRINT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga35b565f6deabbcd077790219f57daeee">TRACE_Address</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga35b565f6deabbcd077790219f57daeee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7c9e933da081232793b8fa60c41c29fe"><td class="memItemLeft" align="right" valign="top">USIZE&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga7c9e933da081232793b8fa60c41c29fe">TRACE_Size</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga7c9e933da081232793b8fa60c41c29fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6cfff844c7e29933289b72c06eb92e76"><td class="memItemLeft" align="right" valign="top">RTN&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga6cfff844c7e29933289b72c06eb92e76">TRACE_Rtn</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga6cfff844c7e29933289b72c06eb92e76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2134ee647c01b25e4ad20cbbddce5ef1"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga2134ee647c01b25e4ad20cbbddce5ef1">TRACE_HasFallThrough</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga2134ee647c01b25e4ad20cbbddce5ef1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a531d7dafb583cd686778bcd48a829a"><td class="memItemLeft" align="right" valign="top">UINT32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga5a531d7dafb583cd686778bcd48a829a">TRACE_NumBbl</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga5a531d7dafb583cd686778bcd48a829a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3dd96087b6ca0031aad3cc4989d888ab"><td class="memItemLeft" align="right" valign="top">UINT32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__TRACE.html#ga3dd96087b6ca0031aad3cc4989d888ab">TRACE_NumIns</a> (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace)</td></tr>
<tr class="separator:ga3dd96087b6ca0031aad3cc4989d888ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Sequence of instructions that is always entered at the top and may have multiple exits. If Pin detects a jump to an instruction in the middle of a trace, it will create a new trace beginning at the target. See <a class="el" href="index.html#GRAN">Instrumentation Granularity</a>.</p>
<p>Iteration idioms:</p>
<div class="fragment"><div class="line"><span class="comment">// Forward pass over all bbls in a trace</span></div>
<div class="line"><span class="keywordflow">for</span>( BBL bbl = <a class="code" href="group__TRACE.html#ga025844ffbef1e892eed7d7ce46f98138">TRACE_BblHead</a>(trace); <a class="code" href="group__BBL.html#gacb48343e32bd7a793b487224ac857b19">BBL_Valid</a>(bbl); bbl = <a class="code" href="group__BBL.html#ga79b074eb89b45ec1cf8e0aa9532b9581">BBL_Next</a>(bbl) )</div>
</div><!-- fragment --> <h2 class="groupheader">Typedef Documentation</h2>
<a id="gad80d434b4df6285334079c19df32a2e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad80d434b4df6285334079c19df32a2e8">&#9670;&nbsp;</a></span>SMC_CALLBACK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef VOID(* SMC_CALLBACK) (ADDRINT traceStartAddress, ADDRINT traceEndAddress, VOID *v)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call back function when SMC is detected. This function can be registered via TRACE_AddSmcDetectedFunction. The callback delivers the start and end addresses of the TRACE containing the SMC. Using this function can potentially cause Pin to use unlimited memory due to SMC tracking.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">traceStartAddress</td><td>The start address of the trace in which SMC is detected </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">traceEndAddress</td><td>The end address of the trace in which SMC is detected </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>The tool's call-back value </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gafbca42a46e490ff446dd4c8e54ea182a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafbca42a46e490ff446dd4c8e54ea182a">&#9670;&nbsp;</a></span>TRACE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef TRACE_CLASS* <a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Container for a trace </p>

</div>
</div>
<a id="ga07cee21d7d56284f183d218ef0c7ebfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07cee21d7d56284f183d218ef0c7ebfe">&#9670;&nbsp;</a></span>TRACE_INSTRUMENT_CALLBACK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef VOID(* TRACE_INSTRUMENT_CALLBACK) (<a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a> trace, VOID *v)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call back function used to instrument traces </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab2f19ff0a9198c83715eea79ada22503"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab2f19ff0a9198c83715eea79ada22503">&#9670;&nbsp;</a></span>TRACE_AddInstrumentFunction()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__PIN__CALLBACKS.html#ga80ecde10e25aa90133f29e875d21d61d">PIN_CALLBACK</a> TRACE_AddInstrumentFunction </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#ga07cee21d7d56284f183d218ef0c7ebfe">TRACE_INSTRUMENT_CALLBACK</a>&#160;</td>
          <td class="paramname"><em>fun</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VOID *&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add a function used to instrument at trace granularity </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun</td><td>Instrumentation function for traces </td></tr>
    <tr><td class="paramname">val</td><td>passed as the second argument to the instrumentation function</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>PIN_CALLBACK A handle to a callback that can be used to further modify this callback's properties</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga35b565f6deabbcd077790219f57daeee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga35b565f6deabbcd077790219f57daeee">&#9670;&nbsp;</a></span>TRACE_Address()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ADDRINT TRACE_Address </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Application address of a trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga2b5767a4ce4604d36829a1befa497223"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b5767a4ce4604d36829a1befa497223">&#9670;&nbsp;</a></span>TRACE_AddSmcDetectedFunction()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID TRACE_AddSmcDetectedFunction </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gad80d434b4df6285334079c19df32a2e8">SMC_CALLBACK</a>&#160;</td>
          <td class="paramname"><em>fun</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VOID *&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Register a call back to be called when Pin detects a self modification of code in the application. See <a class="el" href="group__TRACE.html#gad80d434b4df6285334079c19df32a2e8">SMC_CALLBACK</a> for usage details. <br  />
 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun</td><td>The call back function that is to be called </td></tr>
    <tr><td class="paramname">val</td><td>Value to be passed to fun when it is called</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT <br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga025844ffbef1e892eed7d7ce46f98138"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga025844ffbef1e892eed7d7ce46f98138">&#9670;&nbsp;</a></span>TRACE_BblHead()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BBL TRACE_BblHead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>first bbl of trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga2466f702bf17676b4d37f728caa0692f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2466f702bf17676b4d37f728caa0692f">&#9670;&nbsp;</a></span>TRACE_BblTail()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BBL TRACE_BblTail </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>last bbl of trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga2134ee647c01b25e4ad20cbbddce5ef1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2134ee647c01b25e4ad20cbbddce5ef1">&#9670;&nbsp;</a></span>TRACE_HasFallThrough()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL TRACE_HasFallThrough </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Tells if the last instructon in the trace has a fall-through path.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trace</td><td>The trace. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the last instruction in the trace has a fall-through path. see <a class="el" href="group__INS__INSPECTION.html#ga7602edb17e52e209492bab2c65fc1612">INS_HasFallThrough</a> for more details.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="gae5340cd88a962aac271e3547cdaa024e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae5340cd88a962aac271e3547cdaa024e">&#9670;&nbsp;</a></span>TRACE_InsertCall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID TRACE_InsertCall </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__INST__ARGS.html#ga707ea08e31f44f4a81e2a7766123bad7">IPOINT</a>&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">AFUNPTR&#160;</td>
          <td class="paramname"><em>funptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Insert one or more analysis calls in a trace.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trace</td><td>The trace to instrument. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">action</td><td>Specifies when the analysis call executes: <ul>
<li><code>IPOINT_BEFORE</code> inserts the call before the first instruction in the trace. </li>
<li><code>IPOINT_AFTER</code> inserts the call after the last instruction in the trace. This call will only execute if execution falls-through (i.e. does not branch). You may only use IPOINT_AFTER if the last instruction in the trace has a fall-through path, which you can find out by using <a class="el" href="group__TRACE.html#ga2134ee647c01b25e4ad20cbbddce5ef1">TRACE_HasFallThrough()</a>. </li>
<li><code>IPOINT_ANYWHERE</code> is like IPOINT_BEFORE, but may put the call on a different instruction for better performance. </li>
<li><code>IPOINT_TAKEN_BRANCH</code> inserts a call after each branch in the trace. The call only executes if the trace exits with a taken branch.</li>
</ul>
</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">funptr</td><td>The analysis function to call. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">...</td><td><a class="el" href="group__INST__ARGS.html#ga089c27ca15e9ff139dd3a3f8a6f8451d">IARG_TYPE</a>. Arguments to pass to <em>funptr</em>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga3ce47adf064c67f7289836aa5eabe680"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3ce47adf064c67f7289836aa5eabe680">&#9670;&nbsp;</a></span>TRACE_InsertIfCall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID TRACE_InsertIfCall </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__INST__ARGS.html#ga707ea08e31f44f4a81e2a7766123bad7">IPOINT</a>&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">AFUNPTR&#160;</td>
          <td class="paramname"><em>funptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Insert one or more analysis calls in a trace. If <em>funptr</em> returns a non-zero ADDRINT, then the immediately following "then" analysis call is executed. Note that if <a class="el" href="group__INST__ARGS.html#ga3d1d5f6805cb16d00bce441290ca2212">CALL_ORDER</a> is used, Both "if" and "then" analysis calls must have the same order.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trace</td><td>The trace to instrument. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">action</td><td>Specifies when the analysis call executes. See the documentation in <a class="el" href="group__TRACE.html#gae5340cd88a962aac271e3547cdaa024e">TRACE_InsertCall()</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">funptr</td><td>The analysis function to call. Its return type must be ADDRINT. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">...</td><td><a class="el" href="group__INST__ARGS.html#ga089c27ca15e9ff139dd3a3f8a6f8451d">IARG_TYPE</a>. Arguments to pass to <em>funptr</em>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga88d6254df161fa4aa236e092d8532278"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga88d6254df161fa4aa236e092d8532278">&#9670;&nbsp;</a></span>TRACE_InsertThenCall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID TRACE_InsertThenCall </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__INST__ARGS.html#ga707ea08e31f44f4a81e2a7766123bad7">IPOINT</a>&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">AFUNPTR&#160;</td>
          <td class="paramname"><em>funptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Insert one or more analysis calls in a trace. The functions are called only if the immediately preceding "if" analysis call returns a non-zero value. Note that if <a class="el" href="group__INST__ARGS.html#ga3d1d5f6805cb16d00bce441290ca2212">CALL_ORDER</a> is used, Both "if" and "then" analysis calls must have the same order.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trace</td><td>The trace to instrument. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">action</td><td>Specifies when the analysis call executes. See the documentation in <a class="el" href="group__TRACE.html#gae5340cd88a962aac271e3547cdaa024e">TRACE_InsertCall()</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">funptr</td><td>The analysis function to call. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">...</td><td><a class="el" href="group__INST__ARGS.html#ga089c27ca15e9ff139dd3a3f8a6f8451d">IARG_TYPE</a>. Arguments to pass to <em>funptr</em>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga5a531d7dafb583cd686778bcd48a829a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5a531d7dafb583cd686778bcd48a829a">&#9670;&nbsp;</a></span>TRACE_NumBbl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">UINT32 TRACE_NumBbl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Number of BBLs in trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga3dd96087b6ca0031aad3cc4989d888ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3dd96087b6ca0031aad3cc4989d888ab">&#9670;&nbsp;</a></span>TRACE_NumIns()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">UINT32 TRACE_NumIns </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Number of instructions in trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga6cfff844c7e29933289b72c06eb92e76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6cfff844c7e29933289b72c06eb92e76">&#9670;&nbsp;</a></span>TRACE_Rtn()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RTN TRACE_Rtn </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>RTN that contains first instruction of trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga7c9e933da081232793b8fa60c41c29fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7c9e933da081232793b8fa60c41c29fe">&#9670;&nbsp;</a></span>TRACE_Size()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">USIZE TRACE_Size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__TRACE.html#gafbca42a46e490ff446dd4c8e54ea182a">TRACE</a>&#160;</td>
          <td class="paramname"><em>trace</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Traces represent contiguous segments of the original code. This function returns the original source footprint of the given trace (not the corresponding post-instrumentation footprint in the code cache). </p><dl class="section return"><dt>Returns</dt><dd>Original application code size of a trace</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Linux, Windows &amp; macOS*<br  />
<b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
</div><!-- contents -->
<div class="ttc" id="agroup__BBL_html_gacb48343e32bd7a793b487224ac857b19"><div class="ttname"><a href="group__BBL.html#gacb48343e32bd7a793b487224ac857b19">BBL_Valid</a></div><div class="ttdeci">BOOL BBL_Valid(BBL x)</div></div>
<div class="ttc" id="agroup__TRACE_html_ga025844ffbef1e892eed7d7ce46f98138"><div class="ttname"><a href="group__TRACE.html#ga025844ffbef1e892eed7d7ce46f98138">TRACE_BblHead</a></div><div class="ttdeci">BBL TRACE_BblHead(TRACE trace)</div></div>
<div class="ttc" id="agroup__BBL_html_ga79b074eb89b45ec1cf8e0aa9532b9581"><div class="ttname"><a href="group__BBL.html#ga79b074eb89b45ec1cf8e0aa9532b9581">BBL_Next</a></div><div class="ttdeci">BBL BBL_Next(BBL x)</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
